/**
 * 
 */
package hu.gbalage.owl.editor.internal;

import hu.gbalage.owl.editor.OWLEditorManager;
import hu.gbalage.owl.editor.TabManager;

import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;

/**
 * @author balage
 *
 */
public class OWLEditorTab extends Composite {

	String title;

	private final TabManager tabmanager = new TabManager();
	
	/**
	 * @param parent
	 * @param style
	 */
	public OWLEditorTab(Composite parent, IConfigurationElement element, OWLEditorManager manager) {
		super(parent, SWT.NONE);
		//this.setLayout(new FillLayout());
		title = element.getAttribute("title");
		
		IConfigurationElement[] e = element.getChildren();
		if (e.length != 1){
			System.err.println("there must be exactly 1 child for a tab.");
			return;
		}
		
		this.setLayout(new FillLayout());
		new CompositeEditorItem(this,e[0],manager,tabmanager);
		this.layout();
	}

	public String getTitle(){
		return title;
	}
	
}
